package cm.common.crypto.parameter;

import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;

/**
 * @author jukg
 * @date 2023/07/26 11:25
 * @description
 */
public class InputParameter {

    private static final String VERSION= "";

    @Parameter(names = {"--help","-h"},
            description = "帮助"
    )
    private boolean help;

    @Parameter(names = {"--version","-v"},
            description = "版本号：0.0.1"
    )
    private boolean version;

    @Parameter(names = {"-data"},
            description = "参数"
    )
    private String data;


    public boolean isHelp() {
        return help;
    }

    public void setHelp(boolean help) {
        this.help = help;
    }

    public boolean isVersion() {
        return version;
    }

    public void setVersion(boolean version) {
        this.version = version;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }

    public String run(JCommander jCommander){
        if(version){
            return VERSION;
        }
        if(help){
            jCommander.usage();
        }
        return data;
    }
}
